<%--
  Created by IntelliJ IDEA.
  User: zhaoyang
  Date: 2020/8/3
  Time: 11:40 上午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>处理登录</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    String ip = request.getRemoteHost();
    String name = request.getParameter("username");
    String pass = request.getParameter("userpass");
    if (name.startsWith("admin") && "123".equals(pass)) {
        session.setAttribute("USER_LOGIN",name);

        //转发
        request.getRequestDispatcher("welcome.jsp").forward(request, response);
        return;
    } else {
        //重定向
        response.sendRedirect("loginFail.jsp");
    }


%>


</body>
</html>
